This repository was archived by the owner on Nov 23, 2025. It is now read-only.
Conversation
…es for better security
This commit introduces a complete Role-Based Access Control (RBAC) system with a two-tiered admin structure and exposes all user management functionality through a secure REST API.
Key Features & Fixes:
- **SUPER_ADMIN Role:**
- A `SUPER_ADMIN` role has been introduced to manage other `ADMIN` accounts, establishing a clear security hierarchy.
- The endpoint for creating `ADMIN`s is now restricted to `SUPER_ADMIN`s only.
- **User Management API (`UserController`):**
- A new `UserController` exposes endpoints for administrators to manage the entire user lifecycle:
- List all users (`GET /api/v1/users`)
- Get user details by username (`GET /api/v1/users/{username}`)
- Enable/Disable user accounts (`POST /api/v1/users/{username}/enable|disable`)
- Delete users (`DELETE /api/v1/users/{username}`)
- All endpoints in `UserController` are secured, accessible only to `ADMIN` and `SUPER_ADMIN` roles.
- **Profile-Aware Data Seeding:**
- The `DataSeeder` is now aware of the active Spring profile (`dev` vs. `prod`).
- In the `dev` profile, it seeds a full set of test users (superadmin, admin, employees, customers).
- In production, it safely seeds only the essential `SUPER_ADMIN` account.
- **Fix Unused Methods:**
- This implementation connects all previously unused methods in `UserService` (e.g., `createAdmin`, `findAllUsers`, `enableUser`) to live API endpoints, resolving all related warnings.
…for improved efficiency
This commit introduces a full suite of user management features, fulfilling the administrative and self-service roadmap. Administrators can now manage the entire user lifecycle, and users can manage their own profiles and credentials through the API.
New Administrative Features (Admin/Super-Admin only):
- **Update User Details:** `PUT /api/v1/users/{username}` allows admins to change a user's username, email, and enabled status.
- **Reset Password:** `POST /api/v1/users/{username}/reset-password` allows admins to set a new password for any user.
- **Role Management:** `POST /api/v1/users/{username}/roles` allows admins to dynamically assign or revoke roles for any user.
New Self-Service Features (Authenticated Users):
- **Get Own Profile:** `GET /api/v1/users/me` allows a logged-in user to retrieve their own profile details securely.
- **Change Own Password:** `POST /api/v1/users/me/change-password` allows a user to change their password by providing their current one, enhancing security.
All new endpoints are integrated into the existing RBAC security model, with administrative functions protected and self-service functions accessible to all authenticated users.
…lers - Improve error handling and responses\n- Adjust security rules in to allow correct path matching and bean wiring\n- Clean up controller logic in and to follow conventions and reduce NPE risk\n\nThese changes address runtime warnings observed during local runs and make the auth-service controllers more robust. Verified compile was previously successful.
…n for authentication and user management endpoints
…tor for monitoring
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.